package com.example.demo.entity.primary;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongjunpeng on 2017/10/31.
 */
@Entity
@Table(name = "etl_log")
public class EtlLogEntity {
    private int id;
    private String stepName;
    private String stepId;
    private Short inputRow;
    private Short outputRow;
    private Short readRow;
    private Short updateRow;
    private Short insertRow;
    private Short deleteRow;
    private Integer duration;
    private Timestamp updateTime;
    private String status;
    private String description;
    private Timestamp startTime;
    private Timestamp endTime;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "step_name")
    public String getStepName() {
        return stepName;
    }

    public void setStepName(String stepName) {
        this.stepName = stepName;
    }

    @Basic
    @Column(name = "step_id")
    public String getStepId() {
        return stepId;
    }

    public void setStepId(String stepId) {
        this.stepId = stepId;
    }

    @Basic
    @Column(name = "input_row")
    public Short getInputRow() {
        return inputRow;
    }

    public void setInputRow(Short inputRow) {
        this.inputRow = inputRow;
    }

    @Basic
    @Column(name = "output_row")
    public Short getOutputRow() {
        return outputRow;
    }

    public void setOutputRow(Short outputRow) {
        this.outputRow = outputRow;
    }

    @Basic
    @Column(name = "read_row")
    public Short getReadRow() {
        return readRow;
    }

    public void setReadRow(Short readRow) {
        this.readRow = readRow;
    }

    @Basic
    @Column(name = "update_row")
    public Short getUpdateRow() {
        return updateRow;
    }

    public void setUpdateRow(Short updateRow) {
        this.updateRow = updateRow;
    }

    @Basic
    @Column(name = "insert_row")
    public Short getInsertRow() {
        return insertRow;
    }

    public void setInsertRow(Short insertRow) {
        this.insertRow = insertRow;
    }

    @Basic
    @Column(name = "delete_row")
    public Short getDeleteRow() {
        return deleteRow;
    }

    public void setDeleteRow(Short deleteRow) {
        this.deleteRow = deleteRow;
    }

    @Basic
    @Column(name = "duration")
    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "start_time")
    public Timestamp getStartTime() {
        return startTime;
    }

    public void setStartTime(Timestamp startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "end_time")
    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EtlLogEntity that = (EtlLogEntity) o;

        if (id != that.id) return false;
        if (stepName != null ? !stepName.equals(that.stepName) : that.stepName != null) return false;
        if (stepId != null ? !stepId.equals(that.stepId) : that.stepId != null) return false;
        if (inputRow != null ? !inputRow.equals(that.inputRow) : that.inputRow != null) return false;
        if (outputRow != null ? !outputRow.equals(that.outputRow) : that.outputRow != null) return false;
        if (readRow != null ? !readRow.equals(that.readRow) : that.readRow != null) return false;
        if (updateRow != null ? !updateRow.equals(that.updateRow) : that.updateRow != null) return false;
        if (insertRow != null ? !insertRow.equals(that.insertRow) : that.insertRow != null) return false;
        if (deleteRow != null ? !deleteRow.equals(that.deleteRow) : that.deleteRow != null) return false;
        if (duration != null ? !duration.equals(that.duration) : that.duration != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false;
        if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (stepName != null ? stepName.hashCode() : 0);
        result = 31 * result + (stepId != null ? stepId.hashCode() : 0);
        result = 31 * result + (inputRow != null ? inputRow.hashCode() : 0);
        result = 31 * result + (outputRow != null ? outputRow.hashCode() : 0);
        result = 31 * result + (readRow != null ? readRow.hashCode() : 0);
        result = 31 * result + (updateRow != null ? updateRow.hashCode() : 0);
        result = 31 * result + (insertRow != null ? insertRow.hashCode() : 0);
        result = 31 * result + (deleteRow != null ? deleteRow.hashCode() : 0);
        result = 31 * result + (duration != null ? duration.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
        return result;
    }
}
